package com.group.library.order.controller.admin;

import com.group.library.order.dto.MessageBean;
import com.group.library.order.service.NoticeService;
import com.group.library.order.util.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/notice")
public class NoticeManageController {

    @Autowired
    private NoticeService noticeService;

    @RequestMapping(value = "/listNotice.action",method = RequestMethod.GET)
    public MessageBean listNotice(Integer page,Integer limit,Integer status){
        try{
            return MessageUtil.success("查找成功！",noticeService.findNotice(page,limit,status));
        } catch(Exception e){
            e.printStackTrace();
            return MessageUtil.failure("查找失败！");
        }

    }

}
